<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let users = [
        { name: "John", age: 25 },
        { name: "Pete", age: 30 },
        { name: "Mary", age: 28 },
      ];

      let names = users.map((v) => v.name);
      // let names = users.map((v) => {
      //   return v.name;
      // });
      console.log(names); // ['John','Pete','Mary']
    </script>
  </body>
</html>
